<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //找出score数组中的最大值，并求其数组的平均数
    let score=[56,78,96,86,53,62,77,24,18];
    let max=score[0],avg,sum=0;
    for(let i=1;i<score.length;i++){
        if(score[i]>max){
            max=score[i];
        }
        sum=sum+score[i];//sum=0+56;    sum=56+78=134
    }

    console.log(`最大值为${max}`);
    console.log('总数：'+sum);
    avg=sum/score.length;
    console.log('平均数：'+avg);
    console.log(score.length);
    score[220]=45;
    console.log(score.length);
</script>
</html>